Every code window can show its code as blocks you drag around, as plain text, or (docked) both side by side. They are the same code, and the text is always the real thing.
Every code window - an object's event, a script, a room's creation code, the Macros and Globals windows - has a bar above its code with Blocks and Text. The docked editor's bar also has Side by side. All of them show exactly the same code. A block is only a picture of a line of text, so nothing can drift out of sync, and a line you did not touch is never rewritten.
Press Blocks (or Ctrl+Shift+B). A panel of blocks sits at the side, in sections like Logic, Variables, Movement and Sounds, with a search box on top. Drag a block into the blocks area:
Blocks have holes. A hole that wants the name of one of your own things (an object, sprite, sound, room, path) is a dropdown of the ones in your project. A hole that wants a number or some text takes typing. Every action is one step of Undo.
If/compare is a block with an inside: it runs what is in it only when its comparison is true. The comparison reads left, operator, right. + and/or adds more comparisons, each on its own row with an x to take it out. + else if adds another section and else adds the part that runs when nothing matched, so the block grows from a C shape into an E shape. The rounded Compare block is the same comparison with no inside, for a hole that wants true or false. Loops (repeat, repeat while, count, with) have an inside too.
Almost everything in the language is a block. A line with no block yet shows as a gray CODE block that holds the line exactly as you wrote it, and you can edit it right there. A comment becomes a note block. If a script has a mistake the blocks cannot read, the whole script shows as one gray CODE block, with a note above it, until you fix the mistake in Text; you can still add blocks below it, and the text above stays exactly as it was.
In the docked editor, Side by side shows the blocks and the text together. Click a block and its lines light up in the text; move the cursor in the text and the block that holds that line lights up. Type in the text and the blocks follow a moment after you stop.
Each section of blocks has its own color, and you can change them in File, Preferences, under Block colors.
For a step-by-step walk-through with pictures, see Building code with blocks.